<!--
 * @Description: 工程评估
 * @Author: wangwangwang
 * @Date: 2020-08-17 15:52:58
 * @LastEditors: wangwangwang
 * @LastEditTime: 2021-06-03 14:01:21
-->
<template>
  <div class="pages_content table projectAssess">
    <el-container>
      <el-header>
        <breaDcrumb />
      </el-header>
      <el-main>
        <div class="header_right" @click="showCardNav = !showCardNav">
          <div class="title">搜索</div>
          <div>
            <transition name="from"></transition>
            <span v-show="!showCardNav">
              <i style="margin-right: 5px" class="el-icon-arrow-down"></i>
            </span>
            <transition name="to"></transition>
            <span v-show="showCardNav">
              <i style="margin-right: 5px" class="el-icon-arrow-up"></i>
            </span>
          </div>
        </div>
        <div v-show="showCardNav" class="hr"></div>
        <el-collapse-transition>
          <div v-show="showCardNav">
            <div class="search">
              <span style="display: inline-block;margin-bottom: 10px;">
                <span style="margin-right: 12px">工程名称</span>
                <el-input v-model="tableParam.name" style="width: 200px" clearable placeholder="请输入" @keyup.enter.native="gettableData()" />
              </span>
              <!-- <span style="margin-left: 24px">
                <span style="margin-right: 12px">施工单位</span>
                <el-input v-model="tableParam.roadwork" style="width: 20%; max-width: 200px" clearable placeholder="请输入" @keyup.enter.native="gettableData()" />
              </span> -->
              <el-button icon="el-icon-search" size="medium" class="bottom_all but1" @click="(tableParam.page = 1), gettableData()">查 询</el-button>
              <el-button size="medium" class="bottom_all_two" style="margin-left:12px;" @click="init()">重 置</el-button>
              <el-button size="medium" class="bottom_all_two" style="margin-left: 12px" @click="tableParamType = true">高级搜索</el-button>
            </div>
          </div>
        </el-collapse-transition>
        <div class="hr"></div>
        <div class="card" style="padding-top: 10px">
          <div v-loading="tableLoading" class="card_info" :style="style">
            <el-table :header-cell-style="{ background: '#f3f6f9' }" :cell-style="{ borderRight: 'none' }" border stripe style="width: 100%" :data="tableData" tooltip-effect="dark">
              <el-table-column prop="code" label="工程编号" align="center"></el-table-column>
              <el-table-column prop="name" label="工程名称" align="center"></el-table-column>
              <!-- <el-table-column prop="roadwork" label="施工单位" align="center"></el-table-column>
              <el-table-column prop="roadworklInkman" label="联系人" align="center"></el-table-column>
              <el-table-column prop="roadworkPhone" label="联系电话" align="center"></el-table-column> -->
              <el-table-column prop="createTime" label="登记时间" align="center"></el-table-column>
              <el-table-column prop="principal" label="负责人" align="center"></el-table-column>
              <el-table-column align="center" label="评估状态">
                <template slot-scope="scope">
                  <span v-if="
                      scope.row.assessStatus == 0
                    ">待登记</span>
                  <span v-else-if="scope.row.assessStatus == 2" style="cursor: pointer;" @click="handleToCenterTask">审核中</span>
                  <span v-else-if="scope.row.assessStatus == 3">未通过</span>
                  <span v-else-if="scope.row.assessStatus == 4">已通过</span>
                  <span v-else-if="scope.row.assessStatus == 1">已登记</span>
                  <span v-else-if="scope.row.assessStatus == 5">撤销</span>
                </template>
              </el-table-column>
              <el-table-column prop="riskGrade" label="风险等级" align="center">
                <template slot-scope="scope">
                  <el-link class="table_link" :underline="false" @click="look5Fun(scope.row)">{{scope.row.riskGrade}}</el-link>
                </template>
              </el-table-column>
              <el-table-column prop="forecastEarnings" label="预估收益" align="center"></el-table-column>
              <el-table-column align="left" label="操作" width="160">
                <template slot-scope="scope">
                  <el-button v-if="scope.row.assessStatus == 0&&ButtonList.findIndex(res=>(res.buttonValue=='DENGJI'))!==-1" size="mini" class="bottom_one" @click="regisSubmit(scope.row, false)">登记</el-button>
                  <el-button v-else size="mini" class="bottom_one" @click="regisSubmit(scope.row, true,1)">
                    查看</el-button>
                  <el-button v-if="(scope.row.assessStatus == 1 || scope.row.assessStatus == 3 || scope.row.assessStatus == 5)&&ButtonList.findIndex(res=>(res.buttonValue=='XIUGAI'))!==-1" size="mini" class="bottom_one" @click="regisSubmit(scope.row, true, 2)">
                    修改</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
      </el-main>
      <div class="card_bottom">
        <div class="card_bottom_left">
          <div class="top_page_totle">总共{{ total }}条</div>
          <el-pagination :current-page.sync="tableParam.page" :page-size="tableParam.pageSize" :page-sizes="[10, 20, 30, 40,50,100,200,500,1000]" layout="prev,pager,sizes,next,jumper" :total="total" @size-change="sizeChange" @current-change="gettableData()"></el-pagination>
        </div>
        <div>
          <el-button size="mini" icon="el-icon-refresh-right" class="bottom_all_two" @click="gettableData">刷新</el-button>
        </div>
      </div>
    </el-container>
    <!-- 评估登记 -->
    <el-dialog v-dialogDrag :visible.sync="regisVisible" width="1060px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">{{isReadOnly? '查看工程评估信息': '登记评估信息'}}</span>
      <div class="dialoginfo scroll" style="height: calc(85vh - 230px);padding-right:5px;overflow: auto;">
        <div class="form-container">
          <div class="form-title">
            <div>工程基本信息</div>
            <div v-show="riskRankShow" style="color:rgb(255, 0, 0);">风险等级：{{projectForm.riskGrade}}<span style="margin-left:100px;">预估收益：{{projectForm.forecastEarnings}} 元</span> </div>
          </div>
          <el-form ref="projectForm" :disabled="isReadOnly" :model="projectForm" label-width="110px">
            <el-row>
              <el-col :span="12">
                <el-form-item prop="projectName" :rules="[
                    {
                      required: true,
                      message: '请输入工程名称',
                      trigger: 'blur',
                    },
                  ]">
                  <span slot="label" style="color: #ff0000">工程名称</span>
                  <el-input v-model="projectForm.projectName"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="place" :rules="[
                    {
                      required: true,
                      message: '请输入地理位置',
                      trigger: 'blur',
                    },
                  ]">
                  <span slot="label" style="color: #ff0000">地理位置</span>
                  <el-input v-model="projectForm.place"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item prop="roadworkId" :rules="[
                    {
                      required: true,
                      message: '请输入合同单位',
                      trigger: 'blur',
                    },
                  ]">
                  <span slot="label" style="color: #ff0000">合同单位</span>
                  <el-select v-model="projectForm.roadworkId" style="width:397.33px;" placeholder="请选择">
                    <el-option v-for="(item, index) in roadworkIdList" :key="index" :label="item.name" :value="item.id"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="constructionUnit">
                  <span slot="label">建设单位</span>
                  <el-input v-model="projectForm.constructionUnit"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item prop="projectPropertyId" :rules="[{required: true,message: '请选择工程性质',trigger: 'blur',}]">
                  <span slot="label" style="color: #ff0000">工程性质</span>
                  <el-select ref="projectProperty" v-model="projectForm.projectPropertyId" style="width:397.33px;" placeholder="请选择" @change="$nextTick(()=>{projectForm.projectProperty = $refs.projectProperty.selectedLabel})">
                    <el-option v-for="(item, index) in typeIdList" :key="index" :label="item.itemName" :value="item.id"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="运作模式">
                  <el-select ref="selection1" v-model="projectForm.operationModeId" placeholder="请选择" style="width:397.33px;" @change="$nextTick(()=>{projectForm.operationMode = $refs.selection1.selectedLabel})">
                    <el-option v-for="(item, index) in operationModeList" :key="index" :label="item.itemName" :value="item.id"></el-option>
                  </el-select>
                  <!-- <el-input v-model="projectForm.operationMode"></el-input> -->
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="拟供应站点">
                  <el-input v-model="projectForm.supplyCentre"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="haulDistance" :rules="[{required: true,message: '请输入运距',trigger: 'blur',}]">
                  <span slot="label" style="color: #ff0000">运距</span>
                  <el-input v-model="projectForm.haulDistance" onkeypress='return( /\d|\./.test(String.fromCharCode(event.keyCode)))' @input="projectForm.haulDistance=$regExp.checkNum(projectForm.haulDistance)" @blur="projectForm.haulDistance=$regExp.blurCheckNum(projectForm.haulDistance),haulDistanceFun(projectForm.haulDistance)"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="资金来源">
                  <el-select ref="selection1" v-model="projectForm.capitalSource" placeholder="请选择" style="width:397.33px;">
                    <el-option v-for="(item, index) in capitalSourceList" :key="index" :label="item.itemName" :value="item.id"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="垫资测算">
                  <el-input v-model="projectForm.advanceFund"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="承接价值">
                  <el-input v-model="projectForm.continueMoney"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="estimateNum" :rules="[{required: true,message: '请输入预估用砼量',trigger: 'blur',}]" class="FZYdanWei">
                  <span slot="label" style="color: #ff0000">预估用砼量</span>
                  <el-input v-model="projectForm.estimateNum" onkeypress='return( /\d|\./.test(String.fromCharCode(event.keyCode)))' @input="projectForm.estimateNum=$regExp.checkNum(projectForm.estimateNum)" @blur="projectForm.estimateNum=$regExp.blurCheckNum(projectForm.estimateNum)">
                    <template slot="append">方</template>
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item prop="estimatePrices" :rules="[{required: true,message: '请输入预估单价',trigger: 'blur',}]" class="FZYdanWei">
                  <span slot="label" style="color: #ff0000">预估总收入</span>
                  <el-input v-model="projectForm.estimatePrices" onkeypress='return( /\d|\./.test(String.fromCharCode(event.keyCode)))' @input="projectForm.estimatePrices=$regExp.checkNum(projectForm.estimatePrices)" @blur="projectForm.estimatePrices=$regExp.blurCheckNum(projectForm.estimatePrices)">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="estimateCost" :rules="[{required: true,message: '请输入预估成本',trigger: 'blur',}]" class="FZYdanWei">
                  <span slot="label" style="color: #ff0000">预估总成本</span>
                  <el-input v-model="projectForm.estimateCost" type="number" @input="projectForm.estimateCost=$regExp.checkNum(projectForm.estimateCost)">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="施工工期" style="width: 520px">
                  <el-date-picker v-model="beginTimeFinishTime" style="width:397.33px;" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item v-if="UserInfo.adminStatus == 1" label="负责人" style="width: 520px">
                  <el-cascader ref="getCheckedNodes" v-model="projectForm.principalId" style="width:320px;" :options="principalarr" :show-all-levels="false" :props="{ value: 'id', label: 'name' }" :placeholder="createUserName"></el-cascader>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="挂靠单位" class="FZYdanWei">
                  <el-input v-model="projectForm.attachedUnits"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="施工单位" class="FZYdanWei">
                  <el-input v-model="projectForm.contractSigningUnit"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <!-- <el-row>
              <el-form-item label="工程现场特性描述" class="FZYdanWei">
                <el-input v-model="projectForm.sceneDescription" type="textarea"></el-input>
              </el-form-item>
            </el-row> -->
            <div class="hr"></div>
            <div class="form-title">施工单位情况</div>
            <el-row>
              <el-col :span="12">
                <el-form-item prop="roadworkEnrollTime" :rules="[{required: true,message: '请输入成立时间',trigger: 'blur',}]">
                  <span slot="label" style="color: #ff0000">成立时间</span>
                  <el-date-picker v-model="projectForm.roadworkEnrollTime" type="date" placeholder="选择日期时间" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="roadworkEnrollFund" :rules="[{required: true,message: '请输入注册资本',trigger: 'blur',}]">
                  <span slot="label" style="color: #ff0000">注册资本</span>
                  <el-input v-model="projectForm.roadworkEnrollFund" style="width: 100%" onkeypress='return( /\d|\./.test(String.fromCharCode(event.keyCode)))' @input="projectForm.roadworkEnrollFund=$regExp.checkNum(projectForm.roadworkEnrollFund)" @blur="projectForm.roadworkEnrollFund=$regExp.blurCheckNum(projectForm.roadworkEnrollFund)">
                    <template slot="append">万</template>
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="出资结构">
                  <el-input v-model="projectForm.roadworkRatioInvestments" style="width: 100%"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="经营地址">
                  <el-input v-model="projectForm.roadworkBusinessAddress"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="注册地址">
                  <el-input v-model="projectForm.roadworkDomicile"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-form-item label="抵押情况">
                <el-col :span="5">
                  <el-radio v-model="projectForm.roadworkPledgeStatus" :label="0">无</el-radio>
                  <el-radio v-model="projectForm.roadworkPledgeStatus" :label="1">有</el-radio>
                </el-col>
                <el-col :span="19">
                  <el-input v-model="projectForm.roadworkPledge" :disabled="projectForm.roadworkPledgeStatus===0"></el-input>
                </el-col>
              </el-form-item>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="涉诉情况">
                  <el-col :span="5">
                    <el-radio v-model="projectForm.roadworkLitigationStatus" :label="0">无</el-radio>
                    <el-radio v-model="projectForm.roadworkLitigationStatus" :label="1">有</el-radio>
                  </el-col>
                  <el-col :span="19">
                    <el-input v-model="projectForm.roadworkLitigation" :disabled="projectForm.roadworkLitigationStatus===0"></el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-form-item label="运营情况">
                <el-input v-model="projectForm.roadworkRun"></el-input>
              </el-form-item>
            </el-row>
            <el-row>
              <el-form-item label="合作情况">
                <el-col :span="5">
                  <el-radio v-model="projectForm.roadworkCooperationStatus" :label="0">无</el-radio>
                  <el-radio v-model="projectForm.roadworkCooperationStatus" :label="1">有</el-radio>
                </el-col>
                <el-col :span="19">
                  <el-input v-model="projectForm.roadworkHistoryCooperation" :disabled="projectForm.roadworkCooperationStatus===0"></el-input>
                </el-col>
              </el-form-item>
            </el-row>
            <el-row>
              <el-form-item label="经营潜力">
                <el-input v-model="projectForm.roadworkBusinessPotential"></el-input>
              </el-form-item>
            </el-row>
            <div class="hr"></div>
            <div class="form-title">建设单位情况</div>
            <el-row>
              <el-col :span="12">
                <el-form-item :rules="[{required: true,message: '请输入成立时间',trigger: 'blur',}]">
                  <span slot="label" style="color: #ff0000">成立时间</span>
                  <el-date-picker v-model="projectForm.cuEnrollTime" type="date" placeholder="选择日期时间" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item :rules="[{required: true,message: '注册资本',trigger: 'blur',}]">
                  <span slot="label" style="color: #ff0000">注册资本</span>
                  <el-input v-model="projectForm.cuEnrollFund" type="Number">
                    <template slot="append">万</template>
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="出资结构">
                  <el-input v-model="projectForm.cuRatioInvestments"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="经营地址">
                  <el-input v-model="projectForm.cuBusinessAddress"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="注册地址">
                  <el-input v-model="projectForm.cuDomicile"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-form-item label="抵押情况">
                <el-col :span="5">
                  <el-radio v-model="projectForm.cuPledgeStatus" :label="0">无</el-radio>
                  <el-radio v-model="projectForm.cuPledgeStatus" :label="1">有</el-radio>
                </el-col>
                <el-col :span="19">
                  <el-input v-model="projectForm.cuPledge" :disabled="projectForm.cuPledgeStatus===0"></el-input>
                </el-col>
              </el-form-item>
            </el-row>
            <el-row>
              <el-form-item label="涉诉情况">
                <el-col :span="5">
                  <el-radio v-model="projectForm.cuLitigationStatus" :label="0">无</el-radio>
                  <el-radio v-model="projectForm.cuLitigationStatus" :label="1">有</el-radio>
                </el-col>
                <el-col :span="19">
                  <el-input v-model="projectForm.cuLitigation" :disabled="projectForm.cuLitigationStatus===0"></el-input>
                </el-col>
              </el-form-item>
            </el-row>
            <el-row>
              <el-form-item label="经营潜力">
                <el-input v-model="projectForm.cuBusinessPotential" style="width: 100%"></el-input>
              </el-form-item>
            </el-row>
            <el-row>
              <el-form-item label="开发情况">
                <el-input v-model="projectForm.cuTheCityIsDevelopment" style="width: 100%"></el-input>
              </el-form-item>
            </el-row>
          </el-form>
          <div class="hr"></div>
          <div class="form-title">关键项梳理</div>
          <el-table :header-cell-style="{ background: '#f3f6f9' }" :cell-style="{ borderRight: 'none' }" border stripe style="width: 100%" :data="projectFormData" tooltip-effect="dark">
            <el-table-column prop="name" label="关键项" width="220"></el-table-column>
            <el-table-column label="梳理结果">
              <template slot-scope="scope">
                <el-input v-model="projectForm[scope.row.value]" :disabled="isReadOnly" style="width: 100%"></el-input>
              </template>
            </el-table-column>
            <el-table-column label="结果评分" width="150px">
              <template slot-scope="scope">
                <el-input v-model="projectForm[scope.row.score]" oninput="if(value > 10 ){value = 10} else if (value<1) {value=0}" :disabled="isReadOnly" type="number" style="width:100%"></el-input>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="regisVisible = false">{{isReadOnly? '关 闭': '取 消'}}</el-button>
        <el-button v-if="!isReadOnly" class="bottom_all" type="primary" @click="submitprojectForm('projectForm', 0)">保存</el-button>
        <el-button v-if="!isReadOnly" class="bottom_all" type="primary" @click="submitprojectForm('projectForm', 1)">提交审核</el-button>
      </span>
    </el-dialog>
    <!-- 高级搜索 -->
    <el-dialog v-dialogDrag :visible.sync="tableParamType" width="650px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">高级搜索</span>
      <div class="dialoginfo">
        <el-form ref="reftableParam" :inline="true" :model="tableParam" label-width="110px">
          <el-form-item>
            <span slot="label">联系人</span>
            <el-input v-model="tableParam.roadworklInkman" tplaceholder="请输入" clearable style="width:400px;"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">工程编号</span>
            <el-input v-model="tableParam.code" tplaceholder="请输入" clearable style="width:400px;"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">负责人</span>
            <el-input v-model="tableParam.principal" tplaceholder="请输入" clearable style="width:400px;"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">登记时间</span>
            <el-date-picker v-model="startTimDateEndTimDate" unlink-panels style="width:400px;" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始时间" end-placeholder="结束时间" @change="tableParam.startDate=startTimDateEndTimDate[0]||'',tableParam.endDate=startTimDateEndTimDate[1]||''"></el-date-picker>
          </el-form-item>
          <el-form-item>
            <span slot="label">评估状态</span>
            <el-select v-model="tableParam.assessStatus" placeholder="请选择" style="width:400px;">
              <el-option label="待登记" value="0"></el-option>
              <el-option label="待审核" value="1"></el-option>
              <el-option label="审核中" value="2"></el-option>
              <el-option label="未通过" value="3"></el-option>
              <el-option label="通过" value="4"></el-option>
              <el-option label="撤销" value="5"></el-option>
            </el-select>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="tableParamType=false,tableParam.roadworklInkman='',tableParam.code='',tableParam.principal='',startTimDateEndTimDate=[],tableParam.startDate='',tableParam.endDate='',tableParam.assessStatus=''">取 消</el-button>
        <el-button class="bottom_all" style="margin-left: 24px" @click="gettableData(),tableParamType=false">搜 索</el-button>
      </span>
    </el-dialog>
    <!-- 风险等级 -->
    <el-dialog v-dialogDrag :visible.sync="look5Type" width="750px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">风险因子</span>
      <div class="dialoginfo">
        <div style="color:red;padding-left:20px;">说明：该风险评估结果仅供参考，风险评分1-10分，得分越低，风险越高</div>
        <div class="FZYkaPian">
          <div>
            <table>工程风险</table>
            <div style="margin-top:20px;">运距：{{look5Data.distanceScore}} 分</div>
            <div style="margin-top:10px;">工程性质：{{look5Data.projectPropertyScore}} 分</div>
            <div style="margin-top:10px;">预估用量：{{look5Data.estimateNumScore}} 分</div>
            <div style="margin-top:10px;">资金来源：{{look5Data.capitalSourceScore}} 分</div>
          </div>
          <div>
            <table>施工单位风险</table>
            <div style="margin-top:20px;">成立时间：{{look5Data.enrollTimeScore}} 分</div>
            <div style="margin-top:10px;">注册资本：{{look5Data.enrollFundScore}} 分</div>
            <div style="margin-top:10px;">涉诉情况：{{look5Data.litigationStatusScore}} 分</div>
            <div style="margin-top:10px;">合作情况：{{look5Data.cooperationStatusScore}} 分</div>
          </div>
          <div>
            <table>建设单位风险</table>
            <div style="margin-top:20px;">成立时间：{{look5Data.cuEnrollTimeScore}} 分</div>
            <div style="margin-top:10px;">注册资本：{{look5Data.cuEnrollFundScore}} 分</div>
            <div style="margin-top:10px;">抵押情况：{{look5Data.cuPledgeStatusScore}} 分</div>
            <div style="margin-top:10px;">涉诉情况：{{look5Data.cuLitigationStatusScore}} 分</div>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="look5Type=false">关 闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import mixin from "@/mixins/ICPSmixin.js";
import { queryPage } from "@/api/internetSales/projectManagement.js";
import { queryAllByCompanyId } from "@/api/internetSales/chanceManagement.js";
import {
  saveOrUpdate,
  getDetails,
} from "@/api/internetSales/projectAssess.js";
import { orgUserTree, getDicType } from "@/api/common.js";
import { getUserInfo } from "@/utils/auth.js";
import { setTimeout } from 'timers';
export default {
  mixins: [mixin],
  data() {
    return {
      look5Data: {},
      look5Type: false,
      startTimDateEndTimDate: [],
      tableParamType: false,
      UserInfo: "",
      principalarr: [],
      createUserName: "",
      roadworkIdList: [],
      typeIdList: [],
      beginTimeFinishTime: [],
      /*表格增删改查及下载接口*/
      queryPage: queryPage,
      /*表格数据*/
      tableData: [],
      /*表单页类型，0为无树状，1为有树状，有树状在el-main加上display:flex*/
      pagesType: 0,
      type: 0,
      projectRules: {
        name1: [{ required: true, message: "请输入站点编码", trigger: "blur" }],
      },
      projectFormData: [
        { name: "合同甲方", value: "firstParty", score: 'firstPartyScore' },
        { name: "商务价格", value: "businessPrice", score: 'businessPriceScore' },
        { name: "合同额度", value: "contractAmount", score: 'contractAmountScore' },
        { name: "甲供（卖）材料、周转材料代管约定", value: "appoint", score: 'appointScore' },
        { name: "计量", value: "measure", score: 'measureScore' },
        { name: "结算", value: "settleAccounts", score: 'settleAccountsScore' },
        { name: "发票出具", value: "invoice", score: 'invoiceScore' },
        { name: "付款办法", value: "paymentMethod", score: 'paymentMethodScore' },
        { name: "保证金", value: "earnestMoney", score: 'earnestMoneyScore' },
        { name: "资料交付条件", value: "conditions", score: 'conditionsScore' },
        { name: "供应保障责任", value: "supplyGuarantee", score: 'supplyGuaranteeScore' },
        { name: "质量及技术要求", value: "technicalRequirements", score: 'technicalRequirementsScore' },
        { name: "预期结算及支付制约条款", value: "payTeraty", score: 'payTeratyScore' },
        { name: "停工缓建约定", value: "lockoutTreaty", score: 'lockoutTreatyScore' },
        { name: "争议解决方式", value: "disputeResolution", score: 'disputeResolutionScore' },
        { name: "其他关键条款", value: "otherKeyTerms", score: 'otherKeyTermsScore' },
      ],
      projectForm: {
        projectProperty: '',
        projectPropertyId: ''
      },
      approvalForm: {
        name: "",
      },
      maintainScore: false,
      regisVisible: false,
      theWeight: "",
      disabledExamine: false,
      isReadOnly: true,
      isShowRecordDialog: false,
      recordData: null,
      riskRankShow: false,
      operationModeList: [],
      capitalSourceList: [
        { itemName: '财政预算投资', id: 1 },
        { itemName: '自筹资金投资', id: 2 },
        { itemName: '银行贷款投资', id: 3 },
        { itemName: '利用外资', id: 4 },
        { itemName: '利用有价证券', id: 5 },],
    };
  },
  async created() {
    this.tableParam = { ...this.tableParam, name: "", roadwork: "", isAssess: 2, roadworklInkman: '', code: '', principal: '', startDate: '', endDate: '', assessStatus: '' };
    this.gettableData();
    this.UserInfo = getUserInfo();
    this.principalarr = await orgUserTree();
    queryAllByCompanyId().then((res) => {
      this.roadworkIdList = res.data
    })
    getDicType({ code: "EngineeringNature" }).then((res) => {
      this.typeIdList = res.data.items;
    });
    getDicType({ code: "operationMode" }).then((res) => {
      this.operationModeList = res.data.items;
    });
  },
  methods: {
    look5Fun(row) {
      this.look5Type = true
      getDetails({ engineeringManagementId: row.id }).then((res) => {
        this.look5Data = res.data
      });
    },
    init() {
      /*重置数据*/
      this.tableParam.name = "";
      this.tableParam.roadwork = "";
      this.tableParam.roadworklInkman = "";
      this.tableParam.code = "";
      this.tableParam.principal = "";
      this.startTimDateEndTimDate = "";
      this.tableParam.startDate = "";
      this.tableParam.endDate = "";
      this.tableParam.assessStatus = "";
      this.gettableData();
    },
    regisSubmit(data, isView, type) {
      this.projectForm = {
        engineeringManagementId: data.id,
        projectName: data.name,
        place: data.place,
        roadworkId: data.roadworkId,
        constructionUnit: data.constructionUnit,
        projectPropertyId: data.typeId,
        projectProperty: data.type,
        roadworkPledgeStatus: 0,
        roadworkLitigationStatus: 0,
        roadworkCooperationStatus: 0,
        cuPledgeStatus: 0,
        cuLitigationStatus: 0,
        contractSigningUnit: data.contractSigningUnit,
        estimateNum: data.expectedAmount,
      };
      this.createUserName = data.createUserName
      this.regisVisible = true;
      this.riskRankShow = false
      this.isReadOnly = false;
      if (isView) {
        if (type === 1) {
          this.isReadOnly = true;
        }
        this.riskRankShow = true
        getDetails({ engineeringManagementId: data.id }).then((res) => {
          this.projectForm = res.data;
          if (res.data.beginTime != null) {
            this.beginTimeFinishTime = [
              res.data.beginTime,
              res.data.finishTime,
            ];
          }
        });
      }
    },
    handleToCenterTask () {
      this.$router.push({ name: 'iama' });
    },
    closeSubmit() {
      this.isShowRecordDialog = false;
    },
    hanldeSure() {
      this.gettableData();
      this.isShowRecordDialog = false;
    },
    //评估登记-提交审核
    submitprojectForm(formName, type) { // type 0 保存 1提交审核
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (!this.projectForm.cuEnrollTime) {
            this.$message.warning('请输入建设单位成立时间');
            return
          }
          if (!this.projectForm.cuEnrollFund) {
            this.$message.warning('请输入建设单位注册资本');
            return
          }
          this.projectForm.roadwork = this.roadworkIdList.find(obj => obj.id == this.projectForm.roadworkId)?.name;
          if (this.projectForm.id == undefined) {
            this.projectForm["id"] = "";
          }
          if (this.beginTimeFinishTime != undefined) {
            this.projectForm.beginTime = this.beginTimeFinishTime[0];
            this.projectForm.finishTime = this.beginTimeFinishTime[1];
          }
          if (this.UserInfo.adminStatus == 0) {
            this.projectForm.createUserId = this.UserInfo.userId
            this.projectForm.createUserName = this.UserInfo.userRealName
          } else {
            this.projectForm.createUserId = this.projectForm.createUserId[
              this.projectForm.createUserId.length - 1
            ];
            this.projectForm.createUserName = this.$refs.getCheckedNodes.getCheckedNodes()[0].label
          }
          this.projectForm.gradeList = [this.projectForm.firstPartyScore, this.projectForm.businessPriceScore, this.projectForm.contractAmountScore, this.projectForm.appointScore, this.projectForm.measureScore, this.projectForm.settleAccountsScore, this.projectForm.invoiceScore, this.projectForm.paymentMethodScore, this.projectForm.earnestMoneyScore, this.projectForm.conditionsScore, this.projectForm.supplyGuaranteeScore, this.projectForm.technicalRequirementsScore, this.projectForm.payTeratyScore, this.projectForm.lockoutTreatyScore, this.projectForm.disputeResolutionScore, this.projectForm.otherKeyTermsScore]
          saveOrUpdate(this.projectForm).then((res) => {
            if (res.code === 1001) {
              if (type === 0) {
                this.$message.success('保存成功');
                this.regisVisible = false;
                this.gettableData();
                return
              }
              this.regisVisible = false;
              this.gettableData();
              const params = {
                engineeringManagementId: this.projectForm.engineeringManagementId,
                type: 1,
              }
              this.$router.push({ name: "EngineeringEvaluation", query: params });
            }
          });
        }
      });
    },
    haulDistanceFun(size) {
      setTimeout(() => {
        console.log(size);
        if (size < 1) {
          this.projectForm.haulDistance = ''
        }
      }, 100)
    },
    sizeChange(value) {
      this.tableParam.pageSize = value;
      this.gettableData();
    },
  },
};
</script>

<style lang="scss" src="./project.scss" scoped></style>
<style lang="scss">
.projectAssess {
  .el-input.is- .el-input__inner {
    color: #000;
  }
  .el-select {
    width: 300px;
  }
  .score-container {
    border: 1px solid #e1e5ed;
    .score-list {
      border-bottom: 1px solid #e1e5ed;
      height: 48px;
    }
    .score-list:last-child {
      border: none;
    }
  }
  .score-title {
    margin-bottom: 10px;
  }
  .FZYdanWei {
    > div {
      display: flex;
      font {
        flex: none;
        width: 60px;
        text-align: center;
      }
    }
  }
  .FZYform {
    position: relative;
    label {
      width: 100%;
    }
    .FZYspan1 {
      position: absolute;
      top: 0px;
      right: 300px;
    }
    .FZYspan2 {
      position: absolute;
      top: 0px;
      right: 10px;
    }
    .FZYradio1 {
      position: absolute;
      top: 0px;
      left: 10px;
    }
    .FZYradio1 {
      position: absolute;
      top: 10px;
      left: 90px;
    }
    .FZYradio2 {
      position: absolute;
      top: 10px;
      left: 180px;
    }
  }
}
.table_link {
  margin-left: 10px;
  color: $bg_color !important;
}

.table_link:hover {
  opacity: 0.8;
}
.FZYkaPian {
  display: flex;
  > div {
    flex: 1;
    border-radius: 15px;
    padding: 15px 20px;
    background: #f2f2f2;
    margin: 20px;
    table {
      width: 100%;
      font-size: 16px;
      text-align: center;
      font-weight: 600;
    }
    h5 {
      margin: 15px 0px;
      font-size: 14px;
      font-weight: 600;
    }
  }
}
</style>
